import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

/**
 * title 头部标题
 * auth  页面是否需要等权限  true-需要登录
 */
const routes = [
  {
    path: '/',
    name: 'Layout',
    component: () => import('../views/Layout.vue'),
    redirect: 'find',
    children: [
      {
        path: 'bj',
        name: 'BJ',
        component: () => import('../views/bj/index.vue')
      },
      {
        path: 'find',
        name: 'Find',
        component: () => import('../views/find/index.vue')
      },
      {
        path: '/my',
        name: 'My',
        component: () => import('../views/my/index.vue'),
        meta: {
          auth: true
        }
      },
      {
        path: '/login',
        name: 'Login',
        component: () => import('../views/my/login.vue')
      },
      {
        path: '/my/comb-list',
        name: 'CombList',
        component: () => import('../views/my/CombList.vue'),
        meta: {
          title: '我的组合'
        }
      },
      {
        path: '/my/com',
        name: 'Com',
        component: () => import('../views/my/Com.vue'),
        meta: {
          title: '模拟炒股'
        }
      },
      {
        path: '/my/Subs',
        name: 'Subs',
        component: () => import('../views/my/Subs.vue'),
        meta: {
          title: '我的订阅'
        }
      },
      {
        path: '/my/Fans',
        name: 'Fans',
        component: () => import('../views/my/Fans.vue'),
        meta: {
          title: '我的粉丝',
        }
      },

      {
        path: '/find/Cgdsmore',
        name: 'Cgdsmore',
        component: () => import('../views/find/Cgdsmore.vue'),
        meta: {
          title: '模拟炒股大赛',
        }
      },
      {
        path: '/find/Cgds',
        name: 'Cgds',
        component: () => import('../views/find/Cgds.vue'),
        meta: {
          title: '模拟炒股大赛',
        }
      },
      {
        path: '/find/Mnjy',
        name: 'Mnjy',
        component: () => import('../views/find/Mnjy.vue'),
        meta: {
          title: '模拟交易练习',
        }
      }
    ]
  },
  {
    path: '/find/Mnjymore',
    name: 'Mnjymore',
    component: () => import('../views/find/Mnjymore.vue'),
    meta: {
      title: '模拟交易榜单',
    }
  },
  {
    path:'/find/Testq',
    name:'Testq',
    component:()=> import('../views/find/Testq.vue'),
    meta:{
      title:'测试榜单'
    }

  },

  {
    path: '/jd/index',
    name: 'JD',
    component: () => import('../views/jd/index.vue'),
    meta: {
      title: "京东生鲜",
    }
  },
  {
    path:"/qtly",
    name:"Qt",
    redirect:'/qtly/home',
    component:() => import("@/views/qtly/index.vue"),
    children:[
      {
        path:'home',
        component: () => import("@/views/qtly/home.vue")
      },
      {
        path:'firend',
        component: () => import("@/views/qtly/firend.vue")
      },
      {
        path:'my',
        component: () => import("@/views/qtly/my.vue")
      }
    ]
  }

]

const router = new VueRouter({
  mode: 'hash', // hash history
  // base: process.env.BASE_URL,
  routes
})

export default router
